---
title: How to monitor your Model Context Provider (MCP) server?
description: Learn how to monitor your MCP server with openstatus.
sidebar:
  label: Monitor your MCP Server
---
In this guide, we will show you how to monitor your remote MCP server using OpenStatus. We will use the Hugging Face MCP server for this article, but you can apply the same principles to any MCP server. You can find the code for this guide on [GitHub](https://github.com/openstatusHQ/template/tree/a69eac06e9d3d8579768dad803304e456f56ec33/mcp-server).

**Prerequisites**

-  An OpenStatus account and CLI
-  An MCP server

## Model Context Provider (MCP)

A Model Context Provider is a component that supplies additional context, data, or capabilities to AI models during runtime through the Model Context Protocol (MCP). It acts as a bridge, allowing AI models to access external resources such as databases, APIs, file systems, or other services not included in their original training data.

### What is an MCP Server?

The server component of the MCP protocol hosts and manages external resources, tools, or data sources that AI models can access. It handles incoming requests from MCP clients, processes them according to the protocol specifications, and returns the requested information or executes the specified actions. The MCP server serves as the backend provider, exposing capabilities like database queries, file operations, or API calls in a standardized format for AI models to interact with.

The protocol must adhere to the [JSON-RPC 2.0 specification](https://www.jsonrpc.org/specification).

### JSON-RPC Protocol

JSON-RPC is a remote procedure call protocol that uses JSON as its data format. It is designed to be simple and easy to implement while providing a robust and flexible way to communicate between clients and servers. The JSON-RPC protocol is transport-independent, but for MCP servers, it uses HTTP/HTTPS, making it easy to monitor with OpenStatus.

### Ping Utility

The official [MCP documentation](https://modelcontextprotocol.io/docs/concepts/architecture#debugging-and-monitoring) recommends implementing a health check for your MCP server. The protocol includes a mechanism to verify that the server is still responsive: the ping utility. The ping feature operates using a basic request/response mechanism.

## Create Your OpenStatus Monitor

 OpenStatus allows you to monitor your MCP server by sending a ping request to your MCP server's endpoint on a regular basis from multiple locations around the world. Making it easy to monitor your remote MCP server's health and performance.

### YAML Configuration

The [OpenStatus CLI](/tutorial/get-started-with-openstatus-cli) allows you to create monitor defined in a YAML configuration file. This is perfect solution if want to manage your monitors via GitOps.

Here's an example of a monitor configuration for Hugging Face MCP server:

```YAML
# yaml-language-server: $schema=https://www.openstatus.dev/schema.json

mcp-server:
  name: "HF MCP Server"
  description: "Hugging Face MCP server monitoring"
  frequency: "1m"
  active: true
  regions: ["iad", "ams", "lax"]
  retry: 3
  kind: http
  request:
    url: https://hf.co/mcp
    method: POST
    body: >
      {
        "jsonrpc": "2.0",
        "id": "openstatus",
        "method": "ping"
      }
    headers:
      User-Agent: OpenStatus
      Accept: application/json, text/event-stream
      Content-Type: application/json
  assertions:
    - kind: statusCode
      compare: eq
      target: 200
    - kind: textBody
      compare: eq
      target: '{"result":{},"jsonrpc":"2.0","id":"openstatus"}'
```

### What Does This Monitor Do?

We send an HTTP POST request to the MCP server. The request body contains a JSON-RPC request with the method "ping".

```json
{
  "jsonrpc": "2.0",
  "id": "openstatus",
  "method": "ping"
}
```

We set our headers to accept `application/json` and `text/event-stream`. We also include assertions to verify the response.

First, we check that the status code is 200.

```YAML
    - kind: statusCode
      compare: eq
      target: 200
```

Next, we verify that the response body is correct.

```YAML
    - kind: textBody
      compare: eq
      target: '{"result":{},"jsonrpc":"2.0","id":"openstatus"}'
```

### Using OpenStatus CLI to Create Your Monitor

To create your monitor, use the OpenStatus CLI.

```bash
openstatus create openstatus.yaml
```

## Conclusion

This guide has shown you how to create a monitor for your MCP server using the OpenStatus CLI. You can view the monitor in the OpenStatus dashboard.

For example, here is our monitor for the HF MCP server:

[https://www.openstatus.dev/public/monitors/5961](https://www.openstatus.dev/public/monitors/5961)
